package com.kuke.kukeuser.remote;


import com.kuke.kukecommon.entity.Result;
import com.kuke.kukeproduct.dto.ProductDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(name = "kukeproduct", fallback = ProductControllerFallback.class,path = "/product")
public interface ProductControllerRemote {




    @PostMapping
    public Result add(@RequestBody ProductDTO productDto);


    @DeleteMapping(value = "/{id}")
    public Result delete(@PathVariable(value = "id") Long id);


    @PutMapping(value = "/{id}")
    public Result update(@PathVariable(value = "id") Long id, @RequestBody ProductDTO productDTO);


    /**
     * PathVariable 路径参数，需要加value指定
     * @param id
     * @return
     */
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    Result get(@PathVariable(value = "id") Long id);


    @GetMapping
    public Result query(@RequestParam(value = "name") String name);



}

